#ifndef __SMS_INC__
#define __SMS_INC__

#include <libxml/tree.h>
#include <gdk/gdkkeysyms.h>

#include "layout-register.h"
#include "downloader.h"
#include "exec.h"
#include "theme.h"
#include "listview.h"
#include "button.h"
#include "animate.h"
#include "filelist.h"
#include "update-deamon.h"
#include "textbox.h"
#include "slistview.h"
#include "layout-lan-setting.h"
#include "layout-wifi-setting.h"
//#include "icon-text-view.h"
//#include "icon-list-view.h"

#define SMS_RESOURCE_DIR "/usr/share/sms"
#define TEACHER_VIDEO_XML_DIR "/usr/share/sms/program-xml/teacher-video"
#define TEACHER_VIDEO_RESOURCE_DIR "/usr/share/sms/program-resource/teacher-video"
#define POWEROFF_KEY 65475

typedef enum _RESPONSE
{
    RESPONSE_POWEROFF = 1,
    RESPONSE_QUIT
}Response;

typedef enum _TRANSLATE_TYPE{
	TRANSLATE_UP,
    TRANSLATE_DOWN,
    TRANSLATE_LEFT,
    TRANSLATE_RIGHT
}Translate_type;

typedef struct _SMS
{
	GtkWidget *window,*canvas;
	char *locale;
	char *theme_name;
	LAYOUT_WIN_ID cur_win;
	Layout *wins[LAYOUT_WIN_COUNT];
	Layout *items[LAYOUT_ITEM_COUNT];
	
	gboolean busy;
	UpdateDeamon *deamon;
	
	Exec *app;
	//Config *config;
	Theme *theme;
}SMS;

Layout *sms_change_win_to(SMS *sms,LAYOUT_WIN_ID win_id);
Layout *sms_change_win_with_property(SMS *sms, ...);
int sms_get_win_id(SMS *sms,const char *name);
int sms_get_item_id(SMS *sms,const char *name);
int sms_get_xml_int(xmlNode *a_node,xmlChar* key,int def_val);
double sms_get_xml_double(xmlNode *a_node, xmlChar* key, double def_val);
gboolean sms_get_xml_boolean(xmlNode *a_node, xmlChar* key);
GdkPixbuf *sms_load_pic(const char *path,int width, int height);
#endif
